package cn.iocoder.yudao.module.engine.model.context;

import lombok.Data;

import java.util.HashMap;
import java.util.Map;

@Data
public class SensorStatusContext {
    private Xiong xiong = new Xiong();
    private Yin yin = new Yin();
    private TreeAxisRange treeAxisRange = new TreeAxisRange();
    private TreeAxisFrequency treeAxisFrequency = new TreeAxisFrequency();

    @Data
    public static class Xiong {
        /**
         * 是否触摸
         */
        private boolean touching = false;
    }

    @Data
    public static class Yin {
        /**
         * 速度等级
         */
        private String speedLevel = "";
    }

    @Data
    public static class TreeAxisRange {
        // 最后触发时间
        private Long lastTriggerTime = 0L;

        // 最后触发坐标
        private Integer lastTriggerXAxis = 0;
        private Integer lastTriggerYAxis = 0;
        private Integer lastTriggerZAxis = 0;

        // 速度等级
//        private String speedLevel = null;

    }

    @Data
    public static class TreeAxisFrequency {
        // 首次接收数据时间
        private Long firstReceiveTime = 0L;

        // 最后触发时间
        private Long lastTriggerTime = 0L;

        // 最后触发次数
        private Integer lastTriggerUpCount = 0;

        // 是否开始触发
        private Boolean startTrigger = false;

        // 晃动变动最高次数
        private Integer maxChangeUpCount = 0;

        // 触发器触发情况
        private Map<String, Boolean> triggerId4Triggered = new HashMap<>();

    }

}
